package com.example.springbootthymeleaf0912.controller;


import com.example.springbootthymeleaf0912.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

@Controller
public class ThymeleafController {

    @RequestMapping("/demo")
    public String demo(Model model){
        model.addAttribute("msg","这是: th:text");
        User user = new User("张三", 18, "男");
        List<Object> list = new ArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        model.addAttribute("user",user);
        model.addAttribute("list",list);
        return "demo";
    }

}
